package com.veryGood.controller;

import com.veryGood.domain.dto.PurchaseInfoDTO;
import com.veryGood.domain.dto.SalesInfoDTO;
import com.veryGood.domain.pojo.Inventory;
import com.veryGood.service.InventoryService;
import com.veryGood.service.PurchaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/inventory")
public class PurchaseController {

    @Autowired
    private PurchaseService purchaseService;

    @Autowired
    private InventoryService service;

    @GetMapping("/allruku")
    public List<PurchaseInfoDTO> getAllPurchaseInfo() {
        return purchaseService.getAllPurchaseInfo();
    }
    @GetMapping("/allchuku")
    public List<SalesInfoDTO> getAllSalesInfo() {
        return purchaseService.getAllSalesInfo();
    }

    @GetMapping("/list")
    public List<Inventory> getInventoryList() {
        return service.getInventoryList();
    }
}